from orderApp.addressModel.models import AddressModel


class AddressService:
    def add(self,addressDict):
        address = AddressModel(user_id=addressDict['user_id'],
                               order_id=addressDict['order_id'],
                               receiver=addressDict['receiver'],
                               phone=addressDict['phone'],
                               address=addressDict['address'],
                               remarks=addressDict['remarks'])
        address.save()
    def getByOrderId(self,orderId):
        return AddressModel.objects.get(order_id=orderId)